/**
   Project: primeval compiler
   File: Parser.h
   Authors: Sebastian Zanner Matr.Nr.: 0855172
   E-Mail: sebastian.zanner@stud.sbg.ac.at
*/

#ifndef PARSER_H_INCLUDED
#define PARSER_H_INCLUDED
#include "Scanner.h"
#include "CodeGenerator.h"

int generateCode;
object_t procedureContext;

/* Parser */
void initParser(char ptr filename, int createCode);
void clearParser();
void primeval();
void involvement();
void sequences();
void sequenceList();
void statementSequence();
void statement();
item_t expression();
item_t simpleExpression();
item_t term();
item_t factor();
void selector(item_t item);
void whileStatement();
void ifStatement();
void actualParameters(object_t o);
object_t actualParameter(object_t object, object_t formalParam, int paramNum);
void declaration();
int fieldDeclaration(symTab_t symTab, int offset);
void identList();
object_t identDeclaration(type_t type, int class);
int identListFields(type_t type, symTab_t symTab, int offset);
void fieldIdentList();
void structure();
void procedureDeclaration();
void typeDeclaration();
type_t type();
type_t structType();
void body();
void formalParameters(object_t procedure, object_t formalParam);

#endif // PARSER_H_INCLUDED
